BASS_WASAPI_CheckFormat

Checks if a particular sample format is supported by a device.

DWORD BASS_WASAPI_CheckFormat(
    int device,
    DWORD freq,
    DWORD chans,
    DWORD flags
);

Parameters
deviceThe device to use... -1 = default output device, -2 = default input device. BASS_WASAPI_GetDeviceInfo can be used to enumerate the available devices.
freqThe sample rate.
chansThe number of channels... 1 = mono, 2 = stereo, etc.
flagsAny combination of these flags.
BASS_WASAPI_EXCLUSIVECheck the device in exclusive mode, else shared mode.

Return value
If the sample format is supported, the maximum supported resolution (a BASS_WASAPI_FORMAT value) is returned, else -1 is returned. Use BASS_ErrorGetCode to get the error code.

Error codes
BASS_ERROR_WASAPIWASAPI is not available.
BASS_ERROR_DEVICEdevice is invalid.
BASS_ERROR_DRIVERThe driver could not be initialized.
BASS_ERROR_FORMATThe specified format is not supported by the device.

Remarks
Shared and exclusive modes may have different sample formats available. Only the "mix format" (available from BASS_WASAPI_GetDeviceInfo) is generally supported in shared mode.

See also
BASS_WASAPI_Init